function CDamage_shieldoverlapdistance(localshield, externalshield)
	if localshield == externalshield then return false else
	if not (localshield:IsValid() and externalshield:IsValid()) then return false end
	if (localshield:GetPlayer() == externalshield:GetPlayer()) then
		local intersectvector = localshield:GetPos() - externalshield:GetPos()
		local distance = intersectvector:Length() --Need to find a way to check if a shield is overlapping BEFORE calling this. This function is expensive.
		local intersectiondistance = ((distance^2) - (externalshield:GetNetworkedInt("radius")^2) + (localshield:GetNetworkedInt("radius")^2))/(2*distance)
		if (intersectiondistance >= localshield:GetNetworkedInt("radius") || -intersectiondistance >= localshield:GetNetworkedInt("radius")) then
			return false
		else
			return intersectiondistance
		end
	else
		return false
	end
	end
end

function CDamage_shieldoverlapplane(localshield, externalshield, distance)
	local intersectvector = (localshield:GetPos() - externalshield:GetPos())
	local normal = intersectvector:GetNormal() * -1
	local vector = normal * distance
	return vector, normal
end

if Plane == nil then --Since Jinto's VPlane function wasn't included in the Version 72 Update, i needed to make my own...
	function Plane(normal, point)
		local planestruct = {}
		local relvector = Vector(0, 0, 0) - point
		planestruct.Normal = normal
		planestruct.Distance = -(normal:DotProduct(relvector))
		return planestruct
	end	
end